import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/a.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

// blue text down icon
class NormalDownButton extends StatelessWidget {
  final VoidCallback onTap;
  final String title;
  final EdgeInsets padding;

  const NormalDownButton({Key key, this.onTap, this.title, this.padding})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return PressedOpacityButton(
      padding: padding ?? EdgeInsets.symmetric(horizontal: getDp(20)),
      onPressed: onTap,
      disabledColor: Colors.transparent,
      child: Row(
        children: [
          Text(
            title,
            style: TextStyle(
              color: onTap == null ? aceBlackColor : aceBlueColor,
              fontSize: getSp(16),
              fontWeight: FontWeight.w700,
              height: 1,
            ),
          ),
          if (onTap != null)
            Padding(
              padding: EdgeInsets.only(left: getDp(5)),
              child: SvgPicture.asset(
                A.assetsImagesStyleArrowBlack,
                color: aceBlueColor,
                width: getDp(7),
                height: getDp(7),
                fit: BoxFit.contain,
              ),
            ),
        ],
      ),
    );
  }
}
